<?php
require_once '../../includefiles.php';
require_once '../../model/users.php';
require_once '../../model/membershipplan.php';
require_once '../../model/state.php';
require_once '../../model/city.php';
include_once("../../model/usermembership.php");
include_once("../../model/usermembershipdetail.php");
require_once '../../includes/classes/paypalfunction.php'; // Pay Pal pro Function file 
require_once '../../model/admindetails.php';
include_once '../../model/email.php';
include_once '../../model/paypal.php';
include_once '../../model/nab.php';

$objPlan = new Model_PLAN();

$paypalObj = new Model_Paypal();
$objNAB = new Model_NAB();
$p_paypal = $paypalObj->getDetailsFromPaypal();
$p_nab = $objNAB->getDetailsFromNAB();
$nab= $p_nab[0];

if(!$_SESSION['pregister'])
{
	header("Location: ".SITE_URL."/");
	exit;		
}
if($_POST)
{
	$_SESSION['pregister']['info'] = $_POST;	
}




$getplandetail = $objPlan->getAllPlan();
foreach($getplandetail as  $plan)
{
	if($plan['plan_id'] == $_SESSION['pregister']['info']['plan_id'])
		$current_plan = $plan;
}

$subtotal = $current_plan['price'] + $_SESSION['pregister']['total'];
$subtax = ($nab['tax'] * $subtotal)/100;

$_SESSION['pregister']['subtotal'] = $subtotal;
$_SESSION['pregister']['subtax'] = $subtax;
$_SESSION['pregister']['totalcost'] = $subtotal + $subtax;

$total = number_format($subtotal + $subtax,2);
$smarty->assign('total',$total);
$smarty->assign('subtax',number_format($subtax,2));
$smarty->assign('subtotal',number_format($subtotal,2));
$smarty->assign('plan',$current_plan);
$smarty->assign('cats',$_SESSION['pregister']['cats']);
$smarty->assign('info',$_SESSION['pregister']['info']);
$smarty->assign('tax',$nab['tax']);
$smarty->assign('nab',$p_nab[0]);
$smarty->assign('paypal',$p_paypal[0]);

$yr_arr = array();
for($i=date('Y');$i<=date('Y')+15;$i++)
{
	$yr_arr[] = $i;
}
$smarty->assign('yr_arr',$yr_arr);

$smarty->display(TEMPLATEDIR . '/modules/register/step4.tpl');
unset($smarty);
?>
